/**
 * 
 */
package com.google.gwt.sample.util;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import com.google.gwt.user.client.ui.MultiWordSuggestOracle;

/**
 * @author Prashanth
 *
 */
public class StockFileParser {
	public static MultiWordSuggestOracle fetchStockSymbolOracle(){
		
		MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
		try {
			FileReader stockFileReader = new FileReader("war/input/NASDAQ.txt");
			BufferedReader br = new BufferedReader(stockFileReader);
			br.readLine();
			while(br.ready()){
				oracle.add(br.readLine());
			}	
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return oracle;
	}

}
